<html>
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
     <style type="text/css">
            @import "../dojo/dojo-release-1.0.0/dijit/themes/tundra/tundra.css";
            @import "../dojo/dojo-release-1.0.0/dojo/resources/dojo.css";
            @import "../dojo/dojo-release-1.0.0/dojox/grid/_grid/tundraGrid.css";
            @import "../dojo/dojo-release-1.0.0/dojox/grid/_grid/Grid.css";
            @import "../js/wlProject.css";
			@import "../js/dijitTests.css";
	
      </style>
      <script type="text/javascript" src="../dojo/dojo-release-1.0.0/dojo/dojo.js"  
                djConfig="parseOnLoad: true, isDebug: true,locale: 'zh-cn', extraLocale: ['zh-TW', 'fr']"></script>
      <script>
            dojo.require("dijit.Menu");
            dojo.require("dojo.data.ItemFileWriteStore");
            dojo.require("dijit.layout.SplitContainer");
            dojo.require("dijit.layout.ContentPane");
            dojo.require("dijit.Tree");
            dojo.require("dojo.parser");
            dojo.require("dijit._tree.dndSource");
            dojo.require("dijit.layout.TabContainer");
            dojo.require("dijit.form.Button");
            dojo.require("dojox.grid.Grid");
            dojo.require("dojox.grid._data.model");
            dojo.require("dojo.i18n");
            dojo.require("dojox.validate._base");
            dojo.require("dijit.form.ValidationTextBox");
            dojo.require("dijit.form.TextBox");
            dojo.require("dijit.form.FilteringSelect");
            dojo.require("dojox.grid._data.dijitEditors");
            
            dojo.registerModulePath("mydojo", "../../../js/mydojo");
            dojo.require("mydojo.FilteringSelect");
            dojo.require("mydojo.ValidationTextBox");
            dojo.require("mydojo.NumberTextBox");
     </script>
        
     <script type="text/javascript" src="../js/soapclient.js"></script>
     <script type="text/javascript" src="../js/wlProject.js"></script>
	 <script type="text/javascript" src="../js/load.js"></script>
	 <script type="text/javascript" src="../js/peoplevo.js"></script>
	 <script type="text/javascript" src="../js/customervo.js"></script>
	 <script type="text/javascript" src="../js/task.js"></script>
     <script type="text/javascript" >
     
          var griddata =  new Array();
          var deletedata=new Array();
          var querydata =  new Array();
          var queryvo=new WlLoanVOJs(); //   
          var totalCount=0 ;
          var totalpage=0 ;
          var pagenumber=1;
          var pagesize=4;
          var url=getUrl()+ "services/WlCostManageService";
          var model = new dojox.grid.data.Table(null, griddata);
          var editfield =[{type: 'dojox.GridRowView', width: '20px' },{
                     
                                 cells: [ [
                                            //{name: '????', width: 3, get:getChoise},
                                           { name: 'choise', width: 3,field:0, styles: 'text-align: center;', editor: dojox.grid.editors.Bool },//
                                           { name: 'No.', width: 2, styles: 'text-align: center;', get: function(inRowIndex){ return inRowIndex+1;} },//
                                            {name: 'planLoanFee',field:2, width: 8,editor: dojox.grid.editors.Dijit, editorClass: "mydojo.NumberTextBox", constraint: {min:0,max:9999999,places:4 } }
                                           ,  {name: 'factLoanFee',field:3, width: 8,editor: dojox.grid.editors.Dijit, editorClass: "mydojo.NumberTextBox", constraint: {min:0,max:9999999,places:4 } }
                                               ,   {name: 'remark', field: 4,width: 10, editor: mydojo.ValidationTextBox , required:false ,maxLength:100,invalidMessage:'' }
                                    ,   {name: 'applyTime',field:5, width: 8,editor: dojox.grid.editors.DateTextBox,  formatter: formatDate,  constraint: { selector: "date",datePattern: "yyyy-MM-dd"}}
                                     ,   {name: 'applyTimeTime',field:6, width: 8,editor: dojox.grid.editors.TimeTextBox, formatter: formatDate, constraint: {selector: "time" ,timePattern: "HH:mm"}}
                                         ,   {name: 'planPayTime',field:7, width: 8,editor: dojox.grid.editors.DateTextBox,  formatter: formatDate,  constraint: { selector: "date",datePattern: "yyyy-MM-dd"}}
                                     ,   {name: 'planPayTimeTime',field:8, width: 8,editor: dojox.grid.editors.TimeTextBox, formatter: formatDate, constraint: {selector: "time" ,timePattern: "HH:mm"}}
                                           ,   {name: 'factLoanTime',field:9, width: 8,editor: dojox.grid.editors.DateTextBox,  formatter: formatDate,  constraint: { selector: "date",datePattern: "yyyy-MM-dd"}}
                                     ,   {name: 'factLoanTimeTime',field:10, width: 8,editor: dojox.grid.editors.TimeTextBox, formatter: formatDate, constraint: {selector: "time" ,timePattern: "HH:mm"}}
                                           ,   {name: 'returnTime',field:11, width: 8,editor: dojox.grid.editors.DateTextBox,  formatter: formatDate,  constraint: { selector: "date",datePattern: "yyyy-MM-dd"}}
                                     ,   {name: 'returnTimeTime',field:12, width: 8,editor: dojox.grid.editors.TimeTextBox, formatter: formatDate, constraint: {selector: "time" ,timePattern: "HH:mm"}}
                                 ,   {name: 'borrower', field: 13,width: 10,get: function(inRowIndex){if(querydata[inRowIndex][13]!=undefined){return querydata[inRowIndex][13][2]+'<button dojoType="dijit.form.Button" onclick="viewPeo('+querydata[inRowIndex][13][1]+','+inRowIndex+',13,0,event);"   iconClass="peoIcon">peo</button>'; }else{return '';} }}
                                    ,   {name: 'returnBooker', field: 14,width: 10,get: function(inRowIndex){if(querydata[inRowIndex][14]!=undefined){return querydata[inRowIndex][14][2]+'<button dojoType="dijit.form.Button" onclick="viewPeo('+querydata[inRowIndex][14][1]+','+inRowIndex+',14,0,event);"   iconClass="peoIcon">peo</button>'; }else{return '';} }}
                                    ,   {name: 'returner', field: 15,width: 10,get: function(inRowIndex){if(querydata[inRowIndex][15]!=undefined){return querydata[inRowIndex][15][2]+'<button dojoType="dijit.form.Button" onclick="viewPeo('+querydata[inRowIndex][15][1]+','+inRowIndex+',15,0,event);"   iconClass="peoIcon">peo</button>'; }else{return '';} }}
                                    ,   {name: 'agent', field: 16,width: 10 ,get: function(inRowIndex){if(querydata[inRowIndex][16]!=undefined){return querydata[inRowIndex][16][2]+'<button dojoType="dijit.form.Button" onclick="viewPeo('+querydata[inRowIndex][16][1]+','+inRowIndex+',16,0,event);"   iconClass="peoIcon">peo</button>'; }else{return '';}}}
                                    ,   {name: 'task', field: 17,width: 10 ,get: function(inRowIndex){if(querydata[inRowIndex][17]!=undefined){return querydata[inRowIndex][17][2]+'<button dojoType="dijit.form.Button" onclick="viewTask('+querydata[inRowIndex][17][1]+','+inRowIndex+',17,0,event);"   iconClass="peoIcon">task</button>'; }else{return '';}}}
                                           ] ]
                           }];

function call_funUpd() {
       //var s = grid.selection.getSelected();
       //var  d=new DateTimeQuery();
       //var n=new NumberQuery();
       var sall=grid.model.data;
       for(var i=0;i<sall.length;i++){
       if(sall[i][0]==true){
         var passAll=0;
         var thisCell=sall[i];
         var padd = new SOAPClientParameters2();
         var vobject=new WlLoanVOJs();
         vobject.id=thisCell[1];
//???????????????//
             if(dojox.validate.isInRange(thisCell[2],{max:9999999, min:0})){
              var  n=new NumberQuery(); n.upNumber=thisCell[2];vobject.planLoanFee=n;
             }else{grid.getCell(grid.model.fieldArray[2]).getNode(i).innerHTML="<span style={color:red;line-height:16px}> not be double</span>";passAll=1;}//double

             if(dojox.validate.isInRange(thisCell[3],{max:9999999, min:0})){
              var  n=new NumberQuery(); n.upNumber=thisCell[3];vobject.factLoanFee=n;
             }else{grid.getCell(grid.model.fieldArray[3]).getNode(i).innerHTML="<span style={color:red;line-height:16px}> not be double</span>";passAll=1;}//double

               vobject.remark=thisCell[4];
			 var  d=new DateTimeQuery();
             if(thisCell[5] instanceof Date){ d.upDate=dojo.date.locale.format(thisCell[5], grid.getCell(grid.model.fieldArray[5]).constraint);
             }else{grid.getCell(grid.model.fieldArray[5]).getNode(i).innerHTML="<span style={color:red;line-height:16px}>must be date</span>"; passAll=1;}//not null
              if(thisCell[6] instanceof Date){
             d.upDate=d.upDate+" "+dojo.date.locale.format(thisCell[6], grid.getCell(grid.model.fieldArray[6]).constraint);
             vobject.applyTime=d;
             }else{grid.getCell(grid.model.fieldArray[6]).getNode(i).innerHTML="<span style={color:red;line-height:16px}>must be time</span>"; passAll=1;}//not null
			 
             var  d=new DateTimeQuery();
             if(thisCell[7] instanceof Date){ d.upDate=dojo.date.locale.format(thisCell[7], grid.getCell(grid.model.fieldArray[7]).constraint);
             }else{grid.getCell(grid.model.fieldArray[7]).getNode(i).innerHTML="<span style={color:red;line-height:16px}>must be date</span>"; passAll=1;}//not null
              if(thisCell[8] instanceof Date){
             d.upDate=d.upDate+" "+dojo.date.locale.format(thisCell[8], grid.getCell(grid.model.fieldArray[8]).constraint);
             vobject.planPayTime=d;
             }else{grid.getCell(grid.model.fieldArray[8]).getNode(i).innerHTML="<span style={color:red;line-height:16px}>must be time</span>"; passAll=1;}//not null
			 
              var  d=new DateTimeQuery();
             if(thisCell[9] instanceof Date){ d.upDate=dojo.date.locale.format(thisCell[9], grid.getCell(grid.model.fieldArray[9]).constraint);
             }else{grid.getCell(grid.model.fieldArray[9]).getNode(i).innerHTML="<span style={color:red;line-height:16px}>must be date</span>"; passAll=1;}//not null
              if(thisCell[10] instanceof Date){
             d.upDate=d.upDate+" "+dojo.date.locale.format(thisCell[10], grid.getCell(grid.model.fieldArray[10]).constraint);
             vobject.factLoanTime=d;
             }else{grid.getCell(grid.model.fieldArray[10]).getNode(i).innerHTML="<span style={color:red;line-height:16px}>must be time</span>"; passAll=1;}//not null
			 

             var  d=new DateTimeQuery();
             if(thisCell[11] instanceof Date){ d.upDate=dojo.date.locale.format(thisCell[11], grid.getCell(grid.model.fieldArray[11]).constraint);
             }else{grid.getCell(grid.model.fieldArray[11]).getNode(i).innerHTML="<span style={color:red;line-height:16px}>must be date</span>"; passAll=1;}//not null
              if(thisCell[12] instanceof Date){
             d.upDate=d.upDate+" "+dojo.date.locale.format(thisCell[12], grid.getCell(grid.model.fieldArray[12]).constraint);
             vobject.returnTime=d;
             }else{grid.getCell(grid.model.fieldArray[12]).getNode(i).innerHTML="<span style={color:red;line-height:16px}>must be time</span>"; passAll=1;}//not null

       if(passAll==0){
             if(thisCell[1]==0){//create new row
                padd.add('WlLoanVO',vobject);
                SOAPClient.invoke(url, "createWlLoan", padd, false,  function GetEnu_callBack(ul, soapResponse){
                grid.model.setDatum(ul,i,1);
                });
	         }else{//modify row
                padd.add('WlLoanVO',vobject);
                SOAPClient.invoke(url, "updateWlLoan", padd, false,  function GetEnu_callBack(ul, soapResponse){
                });
	         }
        } }}//for
//submit delete
          for(var i=0;i<deletedata.length;i++){
               var pdel = new SOAPClientParameters();      
               pdel.add('id',deletedata[i]);
               SOAPClient.invoke(url, "deleteWlLoan", pdel, false,  function GetEnu_callBack(ul, soapResponse){
	             
	           });
          }
          deletedata=new Array();
          dojo.byId("rowCount").innerHTML = 'saved'; 
//submit delete end          
 }

 function removeSelectedRowsGrid(){
       //var s = grid.selection.getSelected();
       var s= new Array();
       var sall=grid.model.data;
       for(var i=0;i<sall.length;i++){
       if(sall[i][0]==true){
          s.push(i);
          var thisCell=sall[i];
          if(thisCell[1]!=0){//the row which will be deleted
            deletedata.splice(deletedata.length,0,thisCell[1]);
       }}}
       grid.model.remove(s);//grid.removeSelectedRows();
 }
        
var addRow = function(){
          	grid.addRow([false,0,"","",""],grid.model.getRowCount());
	        } 
   



      var querylayout =[{type: 'dojox.GridRowView', width: '20px' },{
                  //??querySubdata??????     
             cells: [
                      [
                       //{name: '????', width: 3, get:getChoise},
                       { name: 'choise', width: 3, styles: 'text-align: center;', editor: dojox.grid.editors.Bool },//
                       { name: 'No.', width: 2, styles: 'text-align: center;', get: function(inRowIndex){ return inRowIndex+1;} },//
                       {name: 'planLoanFee', width: 10, get: function(inRowIndex){ return querySubdata[2];} }
                     ,   {name: 'factLoanFee', width: 10, get: function(inRowIndex){ return querySubdata[3];} }
                     ,   {name: 'remark', width: 10, get: function(inRowIndex){ return querySubdata[4];} }
//---begin-------------
                     ,   {name: 'applyTime', width: 10, get: function(inRowIndex){ return querySubdata[5];} }
                     ,   {name: 'planPayTime', width: 10, get: function(inRowIndex){ return querySubdata[6];} }
                     ,   {name: 'factLoanTime', width: 10, get: function(inRowIndex){ return querySubdata[7];} }
                     ,   {name: 'returnTime', width: 10, get: function(inRowIndex){ return querySubdata[8];} }
//-----end--                 
                     ,   {name: 'borrower', width: 10, get: function(inRowIndex){ return querySubdata[9];} }
                     ,   {name: 'borrowerId', width: 10, get: function(inRowIndex){ return querySubdata[10];}}//select or pop window
                     ,   {name: 'returnBooker', width: 10, get: function(inRowIndex){ return querySubdata[11];} }
                     ,   {name: 'returnBookerId', width: 10, get: function(inRowIndex){ return querySubdata[12];}}//select or pop window
                     ,   {name: 'returner', width: 10, get: function(inRowIndex){ return querySubdata[13];} }
                     ,   {name: 'returnerId', width: 10, get: function(inRowIndex){ return querySubdata[14];}}//select or pop window
                     ,   {name: 'agent', width: 10, get: function(inRowIndex){ return querySubdata[15];} }
                     ,   {name: 'agentId', width: 10, get: function(inRowIndex){ return querySubdata[16];}}//select or pop window
                     ,   {name: 'task', width: 10, get: function(inRowIndex){ return querySubdata[17];} }
                     ,   {name: 'taskId', width: 10, get: function(inRowIndex){ return querySubdata[18];}}//select or pop window
                      ] ] }];
                          
//query

   
function querybutton(){
              //var p = new SOAPClientParameters2();
              var d,n;
              var validstate=0;
              //queryvo.id=0 ;
              queryvo=new WlLoanVOJs();
              d=queryDate_fun("applyTime");
              if(d==null){validstate=1;}else if(d.upSign!="%"){queryvo.applyTime=d;}
              d=queryDate_fun("planPayTime");
              if(d==null){validstate=1;}else if(d.upSign!="%"){queryvo.planPayTime=d;}
              n=queryNumber_fun("planLoanFee");
              if(n==null){validstate=1;}else if(n.upSign!="%"){queryvo.planLoanFee=n;}  
              d=queryDate_fun("factLoanTime");
              if(d==null){validstate=1;}else if(d.upSign!="%"){queryvo.factLoanTime=d;}
              n=queryNumber_fun("factLoanFee");
              if(n==null){validstate=1;}else if(n.upSign!="%"){queryvo.factLoanFee=n;}  
              d=queryDate_fun("returnTime");
              if(d==null){validstate=1;}else if(d.upSign!="%"){queryvo.returnTime=d;}
              if(queryremark.getDisplayedValue()!="")queryvo.remark=queryremark.getDisplayedValue();//
        if(validstate==0){
              pagenumber=1;
              getVO(queryvo,pagenumber,pagesize,'0');
              if(totalpage>1){dijit.byId("but7").setDisabled(false);}else{dijit.byId("but7").setDisabled(true);}
             }      
       }

 querydis = function(){
               querydisplay("queryDiv");
            }
 
 


function getVO(queryvo,pagenumber,pagesize,orderBy){

      var pu = new SOAPClientParameters2();
      pu.add('WlLoanVO',queryvo) ;
      pu.add('pageNumber',pagenumber) ;
	    pu.add('pageSize',pagesize) ;
	    pu.add('orderBy',orderBy) ;
      SOAPClient.invoke(url,"getWlLoan", pu, false,  function GetEnu_callBack(ul, soapResponse){      
           querydata=WlLoanVOtoArray_fun(ul,true);
           totalCount=ul[ul.length-1]["ns:id"]; 
           totalpage=Math.ceil(new Number(totalCount)/pagesize);
           document.getElementById("rowCount").innerHTML=" "+pagenumber+" / "+totalpage+" / "+totalCount+" " ;
      }); 
      querydata.splice(querydata.length-1,1);
      model.setData(querydata);
      //dijit.byId("grid").updateRowCount(querydata.length); 
 }
 
function init(){
  getVO(queryvo,pagenumber,pagesize,'0');
  if(totalpage>1)dijit.byId("but7").setDisabled(false);
}

 dojo.addOnLoad(init);            
</script>
</head>
<body class="tundra">
     
     	<div id="queryDiv" style="margin-right: 30px;  height: 460px; display:none;" >
              <table align="center" width=100% class="queryTable"  >
                <tr ><td align="center" style="{width:11%}">Please input criterial:</td>
                <td style="{width:22%}" ></td>
                <td style="{width:11%}"></td>
                <td style="{width:6%}" ></td>
                <td style="{width:11%}" ></td>
                <td style="{width:6%}" ></td>
                <td style="{width:11%}"></td>
                <td style="{width:22%}"></td></tr> 
                <tr ><td align="center" style="{width:11%}"></td>
                <td style="{width:22%}" ></td>
                <td style="{width:11%}"></td>
                <td style="{width:6%}" ></td>
                <td style="{width:11%}" ></td>
                <td style="{width:6%}" ></td>
                <td style="{width:11%}"></td>
                <td style="{width:22%}"></td></tr>  
                <tr>
                    <td align="right"   >applyTime:</td> 
                    <td align="left"  colspan="3"><span id="queryapplyTimeImg0"  ><input class="editerDate"   jsId="queryapplyTime" id="queryapplyTime"  constraints="{datePattern:'yyyy-MM-dd'}" dojoType="dijit.form.DateTextBox"  />
                        <input class="editerTime" jsId="queryapplyTimeTime" id="queryapplyTimeTime" value="00:00" dojoType="dijit.form.TimeTextBox" constraints="{timePattern:'HH:mm'}"   invalidMessage="Invalid time. Use HH:mm where HH is 00 - 23 hours."></span>
                        <span id="queryapplyTimeImg1" style="{display:none}" ><input class="editerDateSmaller"   jsId="query1applyTime" id="query1applyTime"  constraints="{datePattern:'yyyy-MM-dd'}" dojoType="dijit.form.DateTextBox"  />
                        <input class="editerTimeSmaller" jsId="query1applyTimeTime" id="query1applyTimeTime" value="00:00" dojoType="dijit.form.TimeTextBox" constraints="{timePattern:'HH:mm'}"   invalidMessage="Invalid time. Use HH:mm where HH is 00 - 23 hours."></span>
                        <span hidefocus="true" style="{display:none}" onclick="selectSign(this);" id="queryapplyTimeImgup">></span>
                        <img src="../image/start.gif" onclick="queryType(this);" id="queryapplyTimeImg" height="15" width="20" border="0">
                        <span hidefocus="false"  style="{display:none}" onclick="selectSign(this);" id="queryapplyTimeImgdown" >></span>
                        <span id="queryapplyTimeImg2div" style="{display:none}"><input class="editerDateSmaller"   jsId="query2applyTime" id="query2applyTime"  constraints="{datePattern:'yyyy-MM-dd'}" dojoType="dijit.form.DateTextBox"  />
                        <input class="editerTimeSmaller" jsId="query2applyTimeTime" id="query2applyTimeTime" value="00:00" dojoType="dijit.form.TimeTextBox" constraints="{timePattern:'HH:mm'}"   invalidMessage="Invalid time. Use HH:mm where HH is 00 - 23 hours."></span>
                    </td>
                    <td align="right"  >planPayTime:</td>
                    <td align="left"  colspan="3" ><span id="queryplanPayTimeImg0"  ><input class="editerDate"   jsId="queryplanPayTime" id="queryplanPayTime"  constraints="{datePattern:'yyyy-MM-dd'}" dojoType="dijit.form.DateTextBox"  />
                        <input class="editerTime" jsId="queryplanPayTimeTime" id="queryplanPayTimeTime" value="00:00" dojoType="dijit.form.TimeTextBox" constraints="{timePattern:'HH:mm'}"   invalidMessage="Invalid time. Use HH:mm where HH is 00 - 23 hours."></span>
                        <span id="queryplanPayTimeImg1" style="{display:none}" ><input class="editerDateSmaller"   jsId="query1planPayTime" id="query1planPayTime"  constraints="{datePattern:'yyyy-MM-dd'}" dojoType="dijit.form.DateTextBox"  />
                        <input class="editerTimeSmaller" jsId="query1planPayTimeTime" id="query1planPayTimeTime" value="00:00" dojoType="dijit.form.TimeTextBox" constraints="{timePattern:'HH:mm'}"   invalidMessage="Invalid time. Use HH:mm where HH is 00 - 23 hours."></span>
                        <span hidefocus="true" style="{display:none}" onclick="selectSign(this);" id="queryplanPayTimeImgup">></span>
                        <img src="../image/start.gif" onclick="queryType(this);" id="queryplanPayTimeImg" height="15" width="20" border="0">
                        <span hidefocus="false"  style="{display:none}" onclick="selectSign(this);" id="queryplanPayTimeImgdown" >></span>
                        <span id="queryplanPayTimeImg2div" style="{display:none}">
                        <input class="editerDateSmaller"   jsId="query2planPayTime" id="query2planPayTime"  constraints="{datePattern:'yyyy-MM-dd'}" dojoType="dijit.form.DateTextBox"  />
                        <input class="editerTimeSmaller" jsId="query2planPayTimeTime" id="query2planPayTimeTime" value="00:00" dojoType="dijit.form.TimeTextBox" constraints="{timePattern:'HH:mm'}"   invalidMessage="Invalid time. Use HH:mm where HH is 00 - 23 hours."></span>
                    </td>
                <tr>
                    <td align="right"  >planLoanFee:</td>
                    <td align="left"  ><span id="queryplanLoanFeeImg0"  ><input type="text" class="editerNumber"   jsId="queryplanLoanFee"  id="queryplanLoanFee"  dojoType="mydojo.NumberTextBox"  /></span>
                        <span id="queryplanLoanFeeImg1" style="{display:none}" ><input type="text"  class="editerNumberSmall" jsId="queryplanLoanFee1"  id="queryplanLoanFee1"  dojoType="mydojo.NumberTextBox"  /></span>
                        <span hidefocus="true" style="{display:none}" onclick="selectSign(this);" id="queryplanLoanFeeImgup">></span>
                        <img src="../image/start.gif" onclick="queryType(this);" id="queryplanLoanFeeImg" height="15" width="20" border="0">
                        <span hidefocus="false"  style="{display:none}" onclick="selectSign(this);" id="queryplanLoanFeeImgdown" >></span>
                        <span id="queryplanLoanFeeImg2div" style="{display:none}"> <input type="text"  class="editerNumberSmall"  jsId="queryplanLoanFee2"  id="queryplanLoanFee2"  dojoType="mydojo.NumberTextBox"  /></span>
                    </td>
                    <td align="right"  >factLoanTime:</td>
                    <td align="left"  colspan="5"><span id="queryfactLoanTimeImg0"  ><input class="editerDate"   jsId="queryfactLoanTime" id="queryfactLoanTime"  constraints="{datePattern:'yyyy-MM-dd'}" dojoType="dijit.form.DateTextBox"  />
                        <input class="editerTime" jsId="queryfactLoanTimeTime" id="queryfactLoanTimeTime" value="00:00" dojoType="dijit.form.TimeTextBox" constraints="{timePattern:'HH:mm'}"   invalidMessage="Invalid time. Use HH:mm where HH is 00 - 23 hours."></span>
                        <span id="queryfactLoanTimeImg1" style="{display:none}" ><input class="editerDateSmall"   jsId="query1factLoanTime" id="query1factLoanTime"  constraints="{datePattern:'yyyy-MM-dd'}" dojoType="dijit.form.DateTextBox"  />
                        <input class="editerTimeSmall" jsId="query1factLoanTimeTime" id="query1factLoanTimeTime" value="00:00" dojoType="dijit.form.TimeTextBox" constraints="{timePattern:'HH:mm'}"   invalidMessage="Invalid time. Use HH:mm where HH is 00 - 23 hours."></span>
                        <span hidefocus="true" style="{display:none}" onclick="selectSign(this);" id="queryfactLoanTimeImgup">></span>
                        <img src="../image/start.gif" onclick="queryType(this);" id="queryfactLoanTimeImg" height="15" width="20" border="0">
                        <span hidefocus="false"  style="{display:none}" onclick="selectSign(this);" id="queryfactLoanTimeImgdown" >></span>
                        <span id="queryfactLoanTimeImg2div" style="{display:none}"><input class="editerDateSmall"   jsId="query2factLoanTime" id="query2factLoanTime"  constraints="{datePattern:'yyyy-MM-dd'}" dojoType="dijit.form.DateTextBox"  />
                        <input class="editerTimeSmall" jsId="query2factLoanTimeTime" id="query2factLoanTimeTime" value="00:00" dojoType="dijit.form.TimeTextBox" constraints="{timePattern:'HH:mm'}"   invalidMessage="Invalid time. Use HH:mm where HH is 00 - 23 hours."></span>
                    </td>
                <tr>
                    <td align="right"  >factLoanFee:</td>
                    <td align="left"  ><span id="queryfactLoanFeeImg0"  ><input type="text" class="editerNumber"   jsId="queryfactLoanFee"  id="queryfactLoanFee"  dojoType="mydojo.NumberTextBox"  /></span>
                        <span id="queryfactLoanFeeImg1" style="{display:none}" ><input type="text"  class="editerNumberSmall" jsId="queryfactLoanFee1"  id="queryfactLoanFee1"  dojoType="mydojo.NumberTextBox"  /></span>
                        <span hidefocus="true" style="{display:none}" onclick="selectSign(this);" id="queryfactLoanFeeImgup">></span>
                        <img src="../image/start.gif" onclick="queryType(this);" id="queryfactLoanFeeImg" height="15" width="20" border="0">
                        <span hidefocus="false"  style="{display:none}" onclick="selectSign(this);" id="queryfactLoanFeeImgdown" >></span>
                        <span id="queryfactLoanFeeImg2div" style="{display:none}"> <input type="text"  class="editerNumberSmall"  jsId="queryfactLoanFee2"  id="queryfactLoanFee2"  dojoType="mydojo.NumberTextBox"  /></span>
                    </td>
                    <td align="right"  >returnTime:</td>
                    <td align="left"  colspan="5"><span id="queryreturnTimeImg0"  ><input class="editerDate"   jsId="queryreturnTime" id="queryreturnTime"  constraints="{datePattern:'yyyy-MM-dd'}" dojoType="dijit.form.DateTextBox"  />
                        <input class="editerTime" jsId="queryreturnTimeTime" id="queryreturnTimeTime" value="00:00" dojoType="dijit.form.TimeTextBox" constraints="{timePattern:'HH:mm'}"   invalidMessage="Invalid time. Use HH:mm where HH is 00 - 23 hours."></span>
                        <span id="queryreturnTimeImg1" style="{display:none}" ><input class="editerDateSmall"   jsId="query1returnTime" id="query1returnTime"  constraints="{datePattern:'yyyy-MM-dd'}" dojoType="dijit.form.DateTextBox"  />
                        <input class="editerTimeSmall" jsId="query1returnTimeTime" id="query1returnTimeTime" value="00:00" dojoType="dijit.form.TimeTextBox" constraints="{timePattern:'HH:mm'}"   invalidMessage="Invalid time. Use HH:mm where HH is 00 - 23 hours."></span>
                        <span hidefocus="true" style="{display:none}" onclick="selectSign(this);" id="queryreturnTimeImgup">></span>
                        <img src="../image/start.gif" onclick="queryType(this);" id="queryreturnTimeImg" height="15" width="20" border="0">
                        <span hidefocus="false"  style="{display:none}" onclick="selectSign(this);" id="queryreturnTimeImgdown" >></span>
                        <span id="queryreturnTimeImg2div" style="{display:none}"><input class="editerDateSmall"   jsId="query2returnTime" id="query2returnTime"  constraints="{datePattern:'yyyy-MM-dd'}" dojoType="dijit.form.DateTextBox"  />
                        <input class="editerTimeSmall" jsId="query2returnTimeTime" id="query2returnTimeTime" value="00:00" dojoType="dijit.form.TimeTextBox" constraints="{timePattern:'HH:mm'}"   invalidMessage="Invalid time. Use HH:mm where HH is 00 - 23 hours."></span>
                    </td>
                <tr>
                    <td align="right"  >remark:</td>
                    <td align="left"  ><input type="text" class="editerInput"  id="queryremark"  jsId="queryremark"   dojoType="dijit.form.TextBox"  /></td>
	
          <tr align="center"><td></td>
           <td colspan="2"><a onclick="querybutton();"><img src="../image/332.gif" height="20" width="20" border="0">OK</a></td>
           <td colspan="3"></td><td colspan="2"></td></tr>
         </table>
	     </div>
	       		<div align="right">
	          	 &nbsp;&nbsp;&nbsp;
	          	     <button dojoType="dijit.form.Button" onclick="addRow();" iconClass="addIcon" >add</button>
	                 <button dojoType="dijit.form.Button" onclick="removeSelectedRowsGrid();" iconClass="delIcon" >delete</button>
	                 <button dojoType="dijit.form.Button" id="but3" jsId="but3" onclick="call_funUpd();"  iconClass="saveIcon">save</button>
	          	     <button dojoType="dijit.form.Button" onclick="querydis();" iconClass="queryIcon" >query</button>
                  
         		</div>    
	    <div style="{height:90%;width:100%}"  >
	         <div id="grid"  dojoType="dojox.Grid" autoWidth="false"  jsId="grid"	model="model"  structure="editfield" singleClickEdit="true" ></div>
      </div> 
      <div align="right" ><span id="rowCount"></span>
        <button dojoType="dijit.form.myButton" onclick="upPage();"  id="but6" disabled='true' jsId="but6" iconClass="upPageIcon" >pageup</button><!--span dojoType="dijit.Tooltip" connectId="but6">pageup</span-->
        <button dojoType="dijit.form.myButton" onclick="downPage();" id="but7" disabled='true' jsId="but7" iconClass="downPageIcon" >pagedown</button><!--span dojoType="dijit.Tooltip" connectId="but7">pagedown</span-->
        <div id="668" dojoType="dijit.form.myDropDownButton" iconClass="pageIcon" ><span>pageNumber</span>
  			  <div dojoType="dijit.Menu">
				  <div dojoType="dijit.MenuItem" label="10"  iconClass="toPageIcon"		onClick="pageSizeChange(this.label);"></div>
				  <div dojoType="dijit.MenuItem"  label="30" iconClass="toPageIcon"		onClick="pageSizeChange(this.label);"></div>
		      <div dojoType="dijit.MenuItem"  label="50" iconClass="toPageIcon"		onClick="pageSizeChange(this.label);"></div>
					<div dojoType="dijit.MenuItem"  label="100" iconClass="toPageIcon"	onClick="pageSizeChange(this.label);"></div>
					<div dojoType="dijit.MenuItem"  label="noPage" iconClass="noPageIcon"	onClick="allpage();"></div>
		      </div><!--span dojoType="dijit.Tooltip" connectId="668"></span-->
        </div>
		    <div id="669" dojoType="dijit.form.myDropDownButton" iconClass="pageStyleIcon"><span>pageStyle</span>
  			   <div dojoType="dijit.Menu">
  				 <div dojoType="dijit.MenuItem"  iconClass="rowIcon"		label="row"	onClick="pageStyle(this.label);"></div>
  				 <div dojoType="dijit.MenuItem"  iconClass="colIcon"		label="col"	onClick="pageStyle(this.label);"></div>
		    </div></div>
     </div>     
</body></html>	
